Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make sure timer based tests pass in firefox as well #590

Closed
wants to merge 1 commit into from

Conversation

mweststrate
Copy link
Member

can someone verify that the tests now succeed in safari as well?

npm run test-browser-safari

thanks!

@coveralls
Copy link

Coverage Status

Coverage remained the same at 95.919% when pulling 597d41a on fix-firefox-tests into c702239 on master.

@yosiat
Copy link

yosiat commented Oct 1, 2016

Hi @mweststrate ,
I tried to run the tests on Safari 9.1, Node v6.7.0 and it looks like the test is stuck for ever, while in firefox it runs instantly.

Here is the test output:

λ ~/projects/mobx/ fix-firefox-tests npm run test-browser-safari

> [email protected] test-browser-safari /Users/yosi/projects/mobx
> npm run small-build && ( browserify test/*.js -t [ babelify --presets [ es2015 ] ] | tape-run --browser safari | faucet )


> [email protected] small-build /Users/yosi/projects/mobx
> scripts/single-file-build.sh

WARN: Dropping unreachable code [lib/mobx.js:1505,4]
WARN: Declarations in unreachable code! [lib/mobx.js:1505,4]
WARN: Dropping unreachable code [lib/mobx.js:1618,8]
WARN: Declarations in unreachable code! [lib/mobx.js:1618,8]
WARN: Dropping unreachable code [lib/mobx.umd.js:1507,4]
WARN: Declarations in unreachable code! [lib/mobx.umd.js:1507,4]
WARN: Dropping unreachable code [lib/mobx.umd.js:1620,8]
WARN: Declarations in unreachable code! [lib/mobx.umd.js:1620,8]
WARN: Dropping unused function invariantObservers [lib/mobx.umd.js:1041,9]
WARN: Dropping unused function invariantLOS [lib/mobx.umd.js:1122,9]
WARN: Dropping unused variable define [lib/mobx.umd.js:1,335]
WARN: Dropping unused variable module [lib/mobx.umd.js:1,342]
WARN: Dropping unused variable exports [lib/mobx.umd.js:1,349]
[BABEL] Note: The code generator has deoptimised the styling of "/Users/yosi/projects/mobx/lib/mobx.js" as it exceeds the max of "100KB".
✓ action should wrap in transaction
✓ action modifications should be picked up 1
✓ action modifications should be picked up 1
✓ action modifications should be picked up 3
✓ test action should be untracked
✓ should be possible to create autorun in ation
✓ should not be possible to invoke action in a computed block
✓ action in autorun should be untracked
✓ action should not be converted to computed when using (extend)observable
✓ #286 exceptions in actions should not affect global state
✓ runInAction
✓ action in autorun does not keep / make computed values alive
✓ computed values and actions
✓ correct api should be exposed
✓ test1
✓ array should support iterall / iterable
✓ find and remove
✓ concat should automatically slice observable arrays, #260
✓ observe
✓ array modification1
✓ serialize
✓ array modification functions
✓ array modifications
✓ new fast array values won't be observable
✓ is array
✓ peek
✓ react to sort changes
✓ autoextend buffer length
✓ array exposes correct keys
✓ autorun passes Reaction as an argument to view function
✓ autorun can be disposed on first run
✓ autorun 1
✓ autorun should not result in loop
# autorunAsync passes Reaction as an argument to view function
  ok 10996 should be equal

If you could guide to how to run the specific test & debug it I will be happy to help.

@mweststrate
Copy link
Member Author

@yosiat it is a bit tricky, you can add a debugger statement to your tests, but you have to make sure you open the devtools quickly enough when the tests start (or at a delay in front) to be able to get at the breakpoint. Pinpointing which tests exactly fail would already be really useful (autorunAsync seems to fail from your output at least)!

@yosiat
Copy link

yosiat commented Oct 3, 2016

@mweststrate is there a way to run only "autorunAsync passes Reaction as an argument to view function" so I can debug it with console.log?

@mweststrate
Copy link
Member Author

@yosiat yes, see: https://github.com/substack/tape#testonlyname-cb

@yosiat
Copy link

yosiat commented Oct 3, 2016

@mweststrate when I run only this test, it finishes instantly, but when I ran it with the all tests it hangs forever.

I will try to debug it using "debugger"

@yosiat
Copy link

yosiat commented Oct 3, 2016

@mweststrate I can't reproduce it for some reason.. but I found something interesting in the tape documentation:

If you forget to t.plan() out how many assertions you are going to run and you don't call t.end() explicitly, your test will hang.

https://github.com/substack/tape

This might be the reason for those rare hangs,
If you I can submit a PR to add plan for this function.

@mweststrate
Copy link
Member Author

PR would be appreciated :) there is suppossed to be a t.end() everywhere
indeed

Op ma 3 okt. 2016 om 12:21 schreef Yosi Attias [email protected]:

@mweststrate https://github.com/mweststrate I can't reproduce it for
some reason.. but I found something interesting in the tape documentation:

If you forget to t.plan() out how many assertions you are going to run and
you don't call t.end() explicitly, your test will hang.

https://github.com/substack/tape

This might be the reason for those rare hangs,
If you I can submit a PR to add plan for this function.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#590 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABvGhInjKkbkF4P_1KqowxK4tbD0RQKUks5qwNcYgaJpZM4KJwQD
.

@yosiat
Copy link

yosiat commented Oct 3, 2016

@mweststrate I finally found what is the strange thing that happens here..
It started that sometimes "auto run 1" and sometimes "autorunAsync passes Reaction as an argument to view function" just waits forever.

I changed the autorunAsync test to logs when we enter setTimeout and when we finishes, and I found that only one/two setTimeout is called and not all timers are called.

When the tests are stuck I open safari dev tools and I see that the tests actually finishes

tape_run_bug
Left is safari devtool, right is terminal

@mweststrate
Copy link
Member Author

Merged into mobx3 branch, closing for now

@mweststrate mweststrate closed this Dec 1, 2016
@mweststrate mweststrate deleted the fix-firefox-tests branch December 25, 2016 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants